﻿@model Kooboo.CMS.Sites.Models.PagePermission
<fieldset>
    <table>
        <tbody>
            @Html.EditorFor(m => m.RequireMember)
            @Html.EditorFor(m => m.AllowGroups, new { HtmlAttributes = new { @class = "medium" } })
            @Html.EditorFor(m => m.AuthorizeMenu)
            @Html.EditorFor(m => m.UnauthorizedUrl, new { HtmlAttributes = new { @class = "medium" } })
        </tbody>
    </table>
</fieldset>
<script>
    $(function () {
        var $requireMember = $('#Permission_RequireMember');
        var $allowGroups = $requireMember.parent().parent().next();
        $requireMember.change(function () {
            if ($requireMember.is(":checked")) {
                $allowGroups.show();
            }
            else {
                $allowGroups.hide();
            }
        });
        $requireMember.trigger('change');
    });
</script>
